Thermo 28 Click
Thermo 28 Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.
Click Library
- Author : Nenad Filipovic
- Date : Nov 2022.
- Type : I2C type
Software Support
Example Description
This example demonstrates the use of Thermo 28 Click board™ by reading and displaying the temperature measurements.
Example Libraries
- MikroSDK.Board
- MikroSDK.Log
- Click.Thermo28
Example Key Functions
- thermo28_cfg_setup Config Object Initialization function.
void thermo28_cfg_setup(thermo28_cfg_t *cfg)
Thermo 28 configuration object setup function.
Thermo 28 Click configuration object.
Definition thermo28.h:239
- thermo28_init Initialization function.
err_t thermo28_init(thermo28_t *ctx, thermo28_cfg_t *cfg)
Thermo 28 initialization function.
Thermo 28 Click context object.
Definition thermo28.h:222
- thermo28_default_cfg Click Default Configuration function.
err_t thermo28_default_cfg(thermo28_t *ctx)
Thermo 28 default configuration function.
- thermo28_get_temperature Thermo 28 get temperature function.
err_t thermo28_get_temperature(thermo28_t *ctx, float *temperature)
Thermo 28 get temperature function.
- thermo28_set_config Thermo 28 set configuration function.
err_t thermo28_set_config(thermo28_t *ctx, thermo28_config_t config)
Thermo 28 set configuration function.
Thermo 28 Click configuration object.
Definition thermo28.h:255
- thermo28_set_continuous_conversion Thermo 28 set continuous conversion function.
err_t thermo28_set_continuous_conversion(thermo28_t *ctx)
Thermo 28 set continuous conversion function.
Application Init
Initializes the driver and performs the Click default configuration.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
if ( I2C_MASTER_ERROR ==
thermo28_init( &thermo28, &thermo28_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
Delay_ms ( 100 );
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
Delay_ms ( 100 );
}
#define THERMO28_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition thermo28.h:127
void application_init(void)
Definition main.c:34
#define MIKROBUS_POSITION_THERMO28
Definition main.c:28
@ THERMO28_ERROR
Definition thermo28.h:142
Application Task
This is an example that shows the use of a Thermo 28 Click board™. Reads the temperature measurement in degree Celsius and displays the results. Results are being sent to the Usart Terminal where you can track their changes.
{
float temperature;
{
log_printf( &logger, " Temperature [degC]: %.2f \r\n", temperature );
Delay_ms ( 1000 );
}
}
void application_task(void)
Definition main.c:72
@ THERMO28_OK
Definition thermo28.h:141
Application Output
This Click board can be interfaced and monitored in two ways:
- Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
- UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.
Additional Notes and Information
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.